package com.viknix.threadpool.manager.config.model;

import com.viknix.threadpool.manager.common.lock.SimpleReadWriteLock;
import lombok.Data;

import java.io.Serializable;

import static com.viknix.threadpool.manager.common.constant.Constants.BLANK;

/**
 * @Author: Dongqi
 * @Date: 2021/11/1 9:10
 * @Version 1.0
 * @Description: 服务端缓存项
 */
@Data
public class CacheItem implements Serializable {

    private String groupKey;

    private volatile String md5 = BLANK;

    private volatile long lastModifiedTs;

    public SimpleReadWriteLock rwLock = new SimpleReadWriteLock();

    public CacheItem(String groupKey) {
        this.groupKey = groupKey;
    }

    public CacheItem(String groupKey, String md5) {
        this.md5 = md5;
        this.groupKey = groupKey;
    }
}
